﻿using System;

namespace Jinjia.Approve.Common.Extensions
{
    public static class TypeExtension
    {
        /// <summary>
        /// 获取指定类型的默认值
        /// </summary>
        /// <param name="targetType"></param>
        /// <returns></returns>
        public static object GetDefaultValue(this Type targetType)
        {
            return targetType.IsValueType ? Activator.CreateInstance(targetType) : null;
        }
    }
}